﻿using FangPage.Common;
using FangPage.Core;
using FangPage.Data;
using FangPage.User.Model;
using FangPage.User;
using System;
using System.Collections.Generic;
using System.Text;

namespace FangPage.User.Controller
{
    public class userprofile : UserController
    {
        public override void Controller()
        {
            UserInfo userinfo = DbHelper.ExcuteModel<UserInfo>(authinfo.userid);

            if (userinfo.id.IsNullOrEmpty())
            {
                FPResponse.ShowErr("该用户已被删除或不存在。", isview);
                return;
            }

            if (ispost)
            {
                userinfo = FPRequest.GetModel(userinfo);

                userinfo.status = 1;

                DbHelper.ExcuteUpdate(userinfo);

                FPResponse.WriteSuccess("修改成功");

                return;
            }

            FPResponse.WriteData(userinfo);
        }
    }
}
